﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	int arr[5] = { 3,1,2,5,4 };
	int i = 0, j = 0;
	for (i = 1; i < 5; i++)
	{
		int r = arr[i];
		j = i - 1;
		while (j >= 0 && arr[j] > arr[i])
		{
			int c = arr[j];
			arr[j] = arr[i];
			arr[i] = c;
		}
	}
	for (i = 0; i < 5; i++)
	{
		printf("%d ", arr[i]);
	}

	return 0;
}